package cate.game.role.pvp.guildwar.msg;

import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBGuildWar;
import easy.java.dev.note.NoteField;
import easy.java.practice.errorcode.EcResult;

@ClientMsg(title = "公会战 挑战 の 请求")
public class GuildWarChallengeReq implements MsgInput {

    @NoteField("据点id")
    public int ptId;

    @NoteField("挑战的难度")
    public int difficulty;

    @NoteField("客户端看到的星星数")
    public int star;

    @Override
    public void execute(GameBody game, ClientContext cc) {
        EcResult<Void> challenge = cc.getRole().getPvp().guildWar.challenge(ptId, difficulty, star);
        game.notice.message(cc.getRole(), challenge, true);
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBGuildWar.CHALLENGE_REQ;
    }
}
